package chpt07;

public class ExceptionTestV2 {
	public static void doSomething(int num) {
		if (num == 0)
			throw new ArithmeticException("num不能为0"); // 手动抛出
		// num不等于0则执行如下代码
		int result = 1 / num;
		System.out.println(result);
	}

	public static void main(String[] args) {
		ExceptionTestV2.doSomething(0);
	}
	
	
}
